home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3067 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: mail2news.demon.co.uk!beachyhd.demon.co.uk
  2. From: Adam@beachyhd.demon.co.uk
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: *SLOW* colour cycling.. :(
  5. Date: 09 Feb 96 21:23:36 GMT
  6. Organization: Beachy Head - UK
  7. Message-ID: <311c0fb8@beachyhd.demon.co.uk>
  8. X-NNTP-Posting-Host: beachyhd.demon.co.uk
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-GateSoftware: AmiGate 1.6 (13.11.95)
  13. MMDF-Warning:  Parse error in original version of preceding line at relay-4.mail.demon.net
  14. X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!beachyhd.demon.co.uk
  15.  
  16. Hi all,
  17.  
  18. I'm trying to make some colour-cycling patterns for a screen saver. However,
  19. I'm having a few problems getting the cycling to work..
  20.  
  21. I've opened a DBLPAL:Lores screen with 8 bitplanes, and drawn my 256-colour
  22. patterns on it. Now it comes to the cycline routines. I've set up 3 arrays of
  23. 256 ULONGS, each array containing all the values for the Red, Green and Blue
  24. parameters of SetRBG32() for the palette.
  25.  
  26. Now to cycle I use the following code:
  27.  
  28.  
  29.  void cycle_colours(void)
  30.  {
  31.     int currcycle,i;
  32.  
  33.     CyclePos = (CyclePos + 20) % Colours;
  34.  
  35.     currcycle = CyclePos;
  36.  
  37.     for (i=0; i<Colours; i++)
  38.     {
  39.       
  40. SetRGB32(&(Screen1->ViewPort),i,Red[currcycle],Green[currcycle],Blue[currcycle]);
  41.  
  42.        currcycle = (currcycle+1) % Colours;
  43.     }
  44.  }      
  45.  
  46.  
  47. This does the job, *BUT*, it takes about half a second to do a single cycle!!
  48. This is absolutely unacceptable.. I want it cycling within 1/25th of a second
  49. at the absolute worst..
  50.  
  51. Now I remember back from my coding days how to perform colour cycling, and it
  52. involves very little work.. I guess that the SetRGB() function performs a lot
  53. of extra functions than just poking numbers in to the copperlist.. Can anyone
  54. suggest a *SYSTEM* *LEGAL* way that I can perform this colour cycling at a
  55. decent speed?
  56.  
  57. Thanks!
  58.  
  59. .\dam.          [Team AMIGA]          //\ ad32@brighton.ac.uk \\/
  60.  
  61.